/**
 * Copyright (c) 2013 Mark Tielemans
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * DISCLAIMER
 * This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of 
 * merchantability and fitness for a particular purpose are disclaimed. In no event shall the regents or contributors be liable for any 
 * direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute 
 * goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in 
 * contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if 
 * advised of the possibility of such damage.
 */
package test.easydb.model;

import java.util.Date;
import java.util.List;

import nl.marktielemans.easydb.model.DataType;
import nl.marktielemans.easydb.model.DatabaseTable;
import nl.marktielemans.easydb.model.IndexType;
import nl.marktielemans.easydb.model.TableColumn;

import org.apache.log4j.Logger;

/**
 * Represents the 'Accounts' tabel in the database.
 * @author Mark Tielemans
 *
 */
public class AccountsTable extends DatabaseTable {

	public static final Logger logger = Logger.getLogger(AccountsTable.class);
	public static final String TABLE_NAME = "Accounts";

	public AccountsTable() {
		super(TABLE_NAME);
	}

	@Override
	public List<TableColumn<?>> getColumns() {
		if(tableColumns.size() == 0) {
			tableColumns.add(new TableColumn<Integer>("id", false, true, DataType.INT, IndexType.SQL_PK));
			tableColumns.add(new TableColumn<String>("uuid", false, false, DataType.VARCHAR, 64, IndexType.SQL_UNIQUE));
			tableColumns.add(new TableColumn<Date>("registerDate", false, false, DataType.DATE, null));
			tableColumns.add(new TableColumn<String>("email", false, false, DataType.VARCHAR, 245, IndexType.SQL_UNIQUE));
			tableColumns.add(new TableColumn<String>("username", false, false, DataType.VARCHAR, 32, IndexType.SQL_UNIQUE));
			tableColumns.add(new TableColumn<String>("password", false, false, DataType.VARCHAR, 64, null));
		}
		return tableColumns;
	}
}
